from gym_pih.hardware.RealsenseCamera import Camera

import cv2

cam=Camera()
cam.Open()
n=0
while True:
    _,image=cam.GetImage()
    image_clip=image[150:214,210:274]
    cv2.namedWindow('image_clip',cv2.WINDOW_NORMAL)
    cv2.imshow('image_clip',image_clip)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
    if cv2.waitKey(1) & 0xFF == ord('s'):
        cv2.imwrite(f"gym_pih\image\{n}.jpg", image_clip)
        n += 1